﻿using System;

namespace MyFloridaHouse.libSvOpenDistricts.ViewModel
{
    public partial class ViewModelBase
    {
        #region properties
        private bool _isOpenStreetMapVisible = true;
        public bool isOpenStreetMapsVisible
        {
            get { return _isOpenStreetMapVisible; }
            set
            {
                if (_isOpenStreetMapVisible != value)
                {
                    _isOpenStreetMapVisible = value;
                    NotifyPropertyChanged("isOpenStreetMapsVisible");
                    NotifyPropertyChanged("openStreetMapsCommandLabel");
                }
            }
        }
        public string openStreetMapsCommandLabel
        {
            get
            {
                if (isOpenStreetMapsVisible)
                {
                    return "Hide Open Street Map";
                }
                else
                {
                    return "Show Open Street Map";
                }
            }
        }
        #endregion        #endregion

        #region Commands
        private bool CmdToggleShowOpenStreetMapsCanExecute(object parameter)
        {
            return true;
        }

        private void CmdToggleShowOpenStreetMapsExecute(object parameter)
        {
            if (isOpenStreetMapsVisible)
            {
                isOpenStreetMapsVisible = false;
            }
            else
            {
                isOpenStreetMapsVisible = true;
            }

        }
        #endregion


    }
}


